#ifndef OBSERVER_H_
#define OBSERVER_H_

class Subject;

class UpdateInfo {
  public:
  /**
   * Type of update to be notified to the observers.
   */
  enum UpdateType {
    SCHEDULE,
    COMPLETED,
    DELETED
  };

  int update_type_;
  Subject* from_subj_;
};

class Observer {
  public:
  virtual ~Observer() = 0;
  virtual void Update(UpdateInfo update_info) = 0;
};

inline Observer::~Observer() {}

class Subject {
  public:
  virtual ~Subject() = 0;
  virtual void RegisterObserver(Observer *o) = 0;
  virtual void RemoveObserver(Observer *) = 0;
  virtual void NotifyObservers() = 0;
};

inline Subject::~Subject() {}


#endif
